#pragma once

#include <jni.h>

namespace gtl
{

namespace jni
{

class strs
{
public:
	strs(JNIEnv* env, jobjectArray jobjs, std::vector<const char*>& vec)
	{
		if(env == NULL || jobjs == NULL)
			return;

		int size = env->GetArrayLength(jobjs);
		for(int i = 0; i < size; ++i)
		{
			jobject jobj = env->GetObjectArrayElement(jobjs, i);
			if(jobj != NULL)
				vec.push_back(env->GetStringUTFChars((jstring)jobj, NULL));
			else			
				vec.push_back((const char*)NULL);
		}
	}
};

} // end of namespace jni

} // end of namespace gtl
